<template>
    <div class="app-container">
        <!-- 用户基础信息 -->
        <h5 class="titleInfo">
            用户基础信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="用户姓名">
                        <span class="spanToInput">{{list.userName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="手机号">
                        <span class="spanToInput">{{list.userPhone | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="服务商姓名">
                        <span class="spanToInput">{{list.customerService | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="服务商手机号">
                        <span class="spanToInput">{{list.serverPhone | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 项目订单基础信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            项目订单基础信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="订单号">
                        <span class="spanToInput">{{list.orderSn | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="订单下单时间">
                        <span class="spanToInput">{{list.createdAt | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="订单状态">
                        <span class="spanToInput">{{list.orderStatus | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="订单支付时间">
                        <span class="spanToInput">{{list.payTime | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="支付方式">
                        <span class="spanToInput">{{list.payment | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="订单应付金额">
                        <span class="spanToInput">{{list.orderPrice | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="抵扣积分">
                        <span class="spanToInput">{{list.deductionIntegral | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="优惠券抵扣">
                        <span class="spanToInput">{{list.couponMoney | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="订单支付金额">
                        <span class="spanToInput">{{list.orderAmount | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 项目预约信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            项目预约信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="预约单号">
                        <span class="spanToInput">{{list.appointmentSn | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="医院名称">
                        <span class="spanToInput">{{list.hospitalName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="项目名称">
                        <span class="spanToInput">{{list.projectName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="预约日期">
                        <span class="spanToInput">{{list.orderTime | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="咨询结果">
                        <span class="spanToInput">{{list.consult | consult}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 项目退款信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            项目退款信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="退款时间">
                        <span class="spanToInput">{{list.refundTime | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="退款说明">
                        <span class="spanToInput">{{list.refundRemark}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>
<script>
    import { findProjectOrderByOrderSn } from '@/api/itemOrder' 
    export default {
        name:"itemOrderInfo",
        data(){
            return {
                userId:"",
                list:{}
            }
        },
        filters:{
            filterNull(e) {
                if(!e){
                    return "暂无"
                }else{
                    return e
                }
            },
            cardNull(e){
                return window.helper.cardType(e)
            },
            userFocus(e){
                return window.helper.userFocus(e)
            },
            consult(e){
                return window.helper.consult(String(e))
            }
        },
        mounted(){
            this.userId = String(this.$route.query.userId)
            this.getList()
        },
        methods:{
            getList(){
                let datas = {id:this.userId}
                findProjectOrderByOrderSn(datas).then().then(res =>{
                    console.log(res)
                    if(!res.data.code){
                        this.list = res.data.data
                    }else{
                        this.$message.error(res.data.msg);
                    }
                })
                .catch(error =>{
                    this.$message.error(error);
                })
            }
        }
    }
</script>

<style scoped>
    .app-container{padding: 0px!important}
    .form{margin-left: 268px}
</style>